Skip to content

Add descriptive labels to Footnote return links - #1211

Merged
rezrah merged 6 commits into
mainfrom
rezrah/fix-footnote-back-url
Jun 20, 2026
Merged

Add descriptive labels to Footnote return links#1211
rezrah merged 6 commits into
mainfrom
rezrah/fix-footnote-back-url

Conversation

@rezrah

@rezrah rezrah commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator

Summary

Towards https://github.com/github/accessibility-audits/issues/14513

Expands the aria-label in return links to include children, per the recommendation made in the a11y audit.

Resolves a sev-2 accessibility bug.

List of notable changes:

  • added the item text to the aria-label
  • updated tests
  • added a changeset

What should reviewers focus on?

  • Check that the aria-label includes the Footnote.Item text

Steps to test:

  1. Go to this (or any) Footnote story
  2. Inspect return icon link, and verify that the aria-label includes the adjacent text

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Please try to provide before and after screenshots or videos

Before After
Screenshot 2025-12-17 at 20 11 27 Screenshot 2025-12-17 at 20 09 25

@rezrah
rezrah requested a review from a team as a code owner December 17, 2025 20:04
Copilot AI review requested due to automatic review settings December 17, 2025 20:04
@changeset-bot

changeset-bot Bot commented Dec 17, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 41750c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@primer/react-brand Patch
@primer/brand-docs Patch
@primer/brand-css Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

🟢 No design token changes found

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the accessibility of Footnote return links by adding descriptive labels that include the footnote content. The change addresses a severity-2 accessibility issue identified in an audit, ensuring screen readers announce more context when reading the back links.

Key changes:

  • Updated the aria-label attribute to include the footnote's text content alongside "Back to content"
  • Modified the corresponding test to verify the new aria-label format
  • Added a changeset documenting this accessibility improvement

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/react/src/Footnotes/Footnotes.tsx Modified aria-label to append children content to "Back to content"
packages/react/src/Footnotes/Footnotes.test.tsx Updated test assertion to match new aria-label format and removed trailing space from test data
.changeset/lucky-socks-carry.md Added changeset documenting the accessibility enhancement
package-lock.json Version bumps across packages (0.60.1 → 0.61.0)

Comment thread packages/react/src/Footnotes/Footnotes.tsx Outdated
Comment thread packages/react/src/Footnotes/Footnotes.test.tsx
@github-actions

github-actions Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

🟢 Unit test coverage changes found

Unit test coverage has been updated through this PR.

Changes: 0 new tests, 0 removed tests, 1 improved, 0 decreased

Component/Hook Statements Functions Branches Change
Footnotes 95.2% 95.5% 100.0% 92.3% +0.2%

@github-actions

github-actions Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

@rezrah
rezrah requested a review from danielguillan December 17, 2025 20:11

@danielguillan danielguillan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rezrah

rezrah commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot fix the merge conflict here please (merge in main)

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the merge conflict here please (merge in main)

Merged main into this branch and resolved the conflict in commit 22ea9420.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🟢 Bundle size report

CheckMainBranchChange
UMD — full bundle (JS)99.35 kB99.46 kB⬆️ +113 B (+0.1%)
UMD — full bundle (CSS)65.46 kB65.46 kB🟢 No change
ESM — full bundle (JS + CSS)1.49 MB1.50 MB⬆️ +2.95 kB (+0.2%)
ESM — tree-shaken simple (Button)68.33 kB68.33 kB🟢 No change
ESM — tree-shaken complex (ActionMenu)77.11 kB77.11 kB🟢 No change

@rezrah
rezrah merged commit 06c14a2 into main Jun 20, 2026
17 checks passed
@rezrah
rezrah deleted the rezrah/fix-footnote-back-url branch June 20, 2026 16:48
@primer primer Bot mentioned this pull request Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants